package com.qnw.CardGroupManagement.adapter;

import android.content.*;
import android.view.*;
import android.widget.*;
import com.qnw.CardGroupManagement.bean.*;
import com.ygo.feihua.*;
import java.util.*;

public class DeckTypeAdapter extends BaseAdapter
{
    private Context context;
	private List<DeckType> data;
	private Zujian zujian;

	public DeckTypeAdapter(Context context, List<DeckType> data)
	 {
	 this.context = context;
	 this.data = data;
	 }

	class  Zujian
	{
        TextView it_text;
    }

    public void sx(){
		notifyDataSetChanged();
	}

    @Override
    public int getCount()
    {
        // TODO: Implement this method
		//if(data!=null){
        return data.size();
		/*	}else{
		 return datas.size();
		 }*/
    }

    @Override
    public Object getItem(int p1)
    {
        // TODO: Implement this method
		//if(data!=null){
        return data.get(p1);
		/*	}else{
		 return datas.get(p1);
		 }*/
    }

    @Override
    public long getItemId(int p1)
    {
        // TODO: Implement this method
        return p1;
    }

    @Override
    public View getView(int position, View p2, ViewGroup p3)
    {
        // TODO: Implement this method
		if(p2==null){
			zujian=new Zujian();
			p2=LayoutInflater.from(context).inflate(R.layout.item_deck_type,null);

			zujian.it_text=(TextView) p2.findViewById(R.id.it_text);
			p2.setTag(zujian);
		}else{
			zujian=(Zujian)p2.getTag();
		}
		
		 zujian.it_text.setText(data.get(position).getName());  
		
		return p2;//返回设置好的view组件，也可以是布局，也可以是控件 
    }
}
